import instance from '../utils/request'

// 获取我的频道列表
export function getMyChannelsApi () {
  return instance({
    url: '/v1_0/user/channels',
    needToken: true
  })
}

// 获取推荐频道列表
export function getRecomChannelsApi () {
  return instance({
    url: '/v1_0/channels'
  })
}
// 获取频道新闻推荐
export function getArticlesApi (params) {
  return instance({
    url: '/v1_1/articles',
    params: params,
    needToken: true
  })
}

// 对文章不喜欢
export function getDislikesApi (data) {
  return instance({
    url: '/v1_0/article/dislikes',
    method: 'POST',
    data: data,
    needToken: true
  })
}

// 举报文章
export function getReportsApi (data) {
  return instance({
    url: '/v1_0/article/reports',
    method: 'POST',
    data: data,
    needToken: true
  })
}

// 拉黑作者
export function getBlackApi (data) {
  return instance({
    url: '/v1_0/user/blacklists',
    method: 'POST',
    data: data,
    needToken: true
  })
}

// 修改频道列表
export function editChannelsApi (data) {
  return instance({
    url: '/v1_0/user/channels',
    method: 'PUT',
    data: data,
    needToken: true
  })
}

// 删除频道列表
export function deleteChannelsApi (data) {
  return instance({
    url: '/v1_0/user/channels',
    method: 'DELETE',
    data,
    needToken: true
  })
}
